It's possible to have multiple dependencies of the same name for a project if a
dependency shows up multiple times as a target-specific dependency. This means
that we can't just find the first one with the relevant name and assume it's the
right one, we instead need to check all of them.